<?php
namespace shenka\controllers;

use Yii;
use yii\web\Controller;
use shenka\models\User;
/*
* @author admin 
* @class Area
* @desc 大冒险（中）&美术棒注册登录地域分布
*/ 

class AreaController extends Controller {
	/*
	* @author admin 
	* @class Area
	* @desc 注册地域分布
	*/ 
	public function actionReg(){
		$view = Yii::$app->view;
		$view->params['layout_data'] = '星球大冒险（中）&美术棒';
		//根据IP地址获取用户注册城市
        //$reg = User::find()->select(['registe_ip'])->limit(15)->asArray()->all();
        //var_dump($reg);exit();
         
        // foreach ($reg as $k => $v) {
        // 	$url = "http://www.bunian.cn/gongjv/ip/?ip=218.12.41.188";
        // 	$ch = curl_init();
        // 	curl_setopt($ch, CURLOPT_URL,$url);
        // 	curl_setopt($ch, CURLOPT_RETURNTRANSFER,TRUE);
        // 	$ipinfo = $ipinfo.curl_exec($ch);
        //  $ipinfo[] = json_decode($data,true);
        //} 

        // $url = "http://www.bunian.cn/gongjv/ip/?ip=218.12.41.188";
        // $ch = curl_init();
        // curl_setopt($ch, CURLOPT_URL,$url);
        // curl_setopt($ch, CURLOPT_RETURNTRANSFER,TRUE);
        // $ipinfo = curl_exec($ch);

		return $this->render('reg');
	}
	/*
	* @author admin 
	* @class Area
	* @desc 登陆地域分布
	*/
	public function actionLog(){
		$view = Yii::$app->view;
		$view->params['layout_data'] = '星球大冒险（中）&美术棒';

		return $this->render('log');
	}

	public function actionTest(){
		$view = Yii::$app->view;
		$view->params['layout_data'] = '星球大冒险（中）&美术棒';

		return $this->render('test');
	}
	
}